﻿@{
    ViewBag.Title = "新增服务元数据";
}
@using YmtRpc.Domain;

<script type="text/javascript" src="~/Scripts/jquery.validate.js"></script>
<script type="text/javascript" src="~/Scripts/jquery.validate.unobtrusive.js"></script>

<form role="form" method="post" action="/ServiceMetadata/Add">
    <div class="control-group">

        <label for="AppId" class="control-label">应用编号：</label>
        <div class="textBoxDiv">
            <input class="form-control" name="AppId" type="text" id="AppId" value="" data-val="true" data-val-required="应用编号不能为空！" /> 
            <span data-valmsg-for="AppId" data-valmsg-replace="true" style="color:red;"></span>
        </div>
        <br />
        <label for="ApiName" class="control-label">接口名称：</label>
        <div class="textBoxDiv">
            <input class="form-control" name="ApiName" type="text" id="ApiName" value="" data-val="true" data-val-required="接口名称不能为空！" /> 
            <span data-valmsg-for="ApiName" data-valmsg-replace="true" style="color:red;"></span>
        </div>

        <br />
        <label for="HttpMethod" class="control-label">http方法：</label>
        <div class="textBoxDiv">

            <input class="form-control" name="HttpMethod" type="text" id="HttpMethod" value="" data-val="true" data-val-required="http方法不能为空！" />
            <span data-valmsg-for="HttpMethod" data-valmsg-replace="true" style="color:red;"></span>
        </div>

        <br />
        <label for="Host" class="control-label">Host：</label>
        <div class="textBoxDiv">
            @Html.TextBox("Host", "", new { @class = "form-control", id = "Host", name = "Host" })
        </div>

        <label for="ApiPath" class="control-label">接口地址：</label>
        <div class="textBoxDiv">
            @Html.TextBox("ApiPath", "", new { @class = "form-control", id = "ApiPath", name = "ApiPath" })
        </div>
        <br />
        <label for="Description" class="control-label">接口的用途描述：</label>
        <div class="textBoxDiv">
            @Html.TextBox("Description", "", new { @class = "form-control", id = "Description", name = "Description" })
        </div>
        <br />
        <label for="Owner" class="control-label">接口的拥有者：</label>
        <div class="textBoxDiv">
            @Html.TextBox("Owner", "", new { @class = "form-control", id = "Owner", name = "Owner" })
        </div>

        <br />
        <input id="save" type="submit" class="btn btn-primary" value="新增" />
    </div>
    <br/>
    <div id="updateResult">

        <div class="validation-summary-valid" data-valmsg summary="true">
            <ul>
                <li style="display: none"></li>
            </ul>
        </div>

        @if (ViewBag.Result == true)
        {
            <label>新增成功</label>
        }

    </div>
</form>